package com.yeban.base.day03;

import java.util.Scanner;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/9/27
 */
public class Switch_work02 {

    public static void main(String[] args) {

        // 提示输入两个数字和符号
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入第一个数字: ");
        int number1 = sc.nextInt();
        System.out.print("请输入第二个数字: ");
        int number2 = sc.nextInt();
        System.out.print("请输入运算符号: ");
        String operator = sc.next();

        //进行运算
        switch (operator) {
            case "+":
                System.out.println("两数之和：" + (number1 + number2));
                break;
            case "-":
                System.out.println("两数之差：" + (number1 - number2));
                break;
            case "*":
                System.out.println("两数之积：" + (number1 * number2));
                break;
            case "/":
                System.out.println("两数相除：" + (number1 / number2));
                break;
            case "%":
                System.out.println("两数除余：" + (number1 % number2));
                break;
            default:
                System.out.println("运算符输入错误，不存在该字符！");
                break;
        }

    }
}
